package jms.consumer;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

/**
* Created by WangXJ
* 2018-06-12 14:40
*/
public class ConsumerMessageListener implements MessageListener{

	@Override
	public void onMessage(Message message) {
		TextMessage textMessage = (TextMessage) message;
		//打印日志
		try {
			System.out.println("接收消息成功！  内容为:"+textMessage.getText());
		} catch (JMSException e) {
			e.printStackTrace();
		}
	}

}
